package com.course.app.transformer;

import com.course.app.api.data.CourseDTO;
import com.course.domain.model.CourseInfo;

import java.util.Date;

/**
 * Created by Justin on 2017/5/30.
 */
public class CourseTransformer {

    public static CourseDTO toDTO(CourseInfo courseInfo, Date beginDate) {
        CourseDTO courseDTO = new CourseDTO();
        courseDTO.setId(courseInfo.getId());
        courseDTO.setTitle(courseInfo.getTitle());
        courseDTO.setDetail(courseInfo.getDetail());
        courseDTO.setWeeks(courseInfo.getWeeks());
        courseDTO.setBeginDate(toDate(beginDate));
        return courseDTO;
    }

    private static Date toDate(Date date) {
        return date;
    }
}
